<template>
  <div class="My">
    <div class="top">
      <div class="touxiang">
        <img src="../assets/logo.png" width="100%" alt />
      </div>
      <div class="name">{{userName=""?('用户2234'):userName}}</div>
    </div>
    <div class="piao">
      <div class="dianyingpiao">
        <div class="dianyingpiao-icon">
          <img src="../assets/dianyingpiao.png" width="40px" alt />
        </div>
        <div class="dianyingpiao-text">
          <p class="my">我的电影票</p>
          <p class="count">0</p>
        </div>
      </div>
      <div class="youhui">
        <div class="youhui-icon">
          <img src="../assets/youhuiquan.png" width="40px" alt />
        </div>
        <div class="youhui-text">
          <p class="my">我的优惠券</p>
          <p class="count">0</p>
        </div>
      </div>
    </div>
    <div class="myMovie">
      <p class="myMovieText">个人资料</p>
      <i class="right"></i>
    </div>
    <div class="myMovie">
      <p class="myMovieText">我的订单</p>
      <i class="right"></i>
    </div>
    <div class="myMovie">
      <p class="myMovieText">我的电影</p>
      <i class="right"></i>
    </div>
    <div class="myMovie">
      <p class="myMovieText">地址管理</p>
      <i class="right"></i>
    </div>
  </div>
</template>
<script>
export default {
  name: "My",
  data() {
    return {
      userName: ""
    };
  },
  created() {
    this.GetUserName();
  },
  methods: {
    GetUserName() {
      if (localStorage.getItem("user")) {
        this.userName = JSON.parse(localStorage.getItem("user")).nickName;
      }
    }
  }
};
</script>
<style lang="less" scoped>
.top {
  background-color: rgb(255, 255, 255);
  display: flex;
  padding: 10px 20px;
  .touxiang {
    width: 50px;
    border-radius: 50%;
    padding: 5px 5px;
    position: relative;
    background-color: #eee;
    img {
      margin-top: 2px;
    }
  }
  .name {
    margin-left: 20px;
    margin-top: 20px;
    font-size: 18px;
  }
}
.piao {
  background-color: rgb(255, 255, 255);
  display: flex;
  border-bottom: 1px solid #eee;
  .dianyingpiao {
    padding: 10px 10px;
    display: flex;
    width: 50%;
    align-items: center;
    text-align: center;
    border-right: 1px solid #eee;
    .dianyingpiao-icon {
      margin-right: 20px;
    }
  }
  .youhui {
    padding: 10px 10px;
    width: 50%;
    display: flex;
    align-items: center;
    text-align: center;
    .youhui-icon {
      margin-right: 20px;
    }
  }
}
.myMovie {
  position: relative;
  background-color: rgb(255, 255, 255);
  border: 1px solid #eee;
  height: 40px;
  margin-top: 5px;
  .myMovieText {
    margin-left: 20px;
  }
  .right {
    position: absolute;
    top: 15px;
    right: 20px;
    transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    border: 1px solid rgb(163, 153, 156);
    border-width: 0 1px 1px 0;
    display: inline-block;
    padding: 3px;
  }
}
</style>